{extend name="public/base"}

{block name="title"}域名目录设置列表{/block}

{block name="main"}
<!--  搜索添加   -->

<!--数据列表-->
<table class="layui-table">
    <thead class="bg-light">
    <tr>
        <th class="text-center">ID</th>
        <th class="text-center">目录所属域名</th>
        <th class="text-center">目录名称</th>
        <th class="text-center">目录url</th>
        <th class="text-center">目录img</th>
        <th class="text-center">广告</th>
        <th class="text-center">SEO信息</th>
        <th class="text-center">创建时间</th>
        <th class="text-center">操作</th>
    </tr>
    </thead>
    <tbody>
    {assign name="empty" value='<tr><td colspan="18" class="text-center text-muted">没有数据</td></tr>'}
    {volist name="list" id="obj" }
    {volist name="obj.hostcat" id="vo" empty="$empty"}
    <tr>
        <td class="text-center" style="line-height: 80px">{$vo.id}</td>
        <td class="text-center" style="line-height: 80px">{$obj.host}</td>
        <td class="text-center" style="line-height: 80px">{$vo.name}</td>
        <td class="text-center" style="line-height: 80px">{$vo.url}</td>
        <td class="text-center" ><img src="{$vo.img}" style="width: 120px;height: 80px" alt="目录图片"/></td>
        <td class="text-center"><a href="{:url('/hostadv/'.$vo.id)}" class="layui-btn layui-btn-warning layui-btn-sm">广告</a></td>
        <td class="text-center"><a href="{:url('/hostinfo/'.$vo.id)}" class="layui-btn layui-btn-warning layui-btn-sm">SEO信息</a></td>
        <td class="text-center" style="line-height: 80px">{$vo.create_at}</td>

        <td class="text-center" style="line-height: 80px">
            <form action="{:url('/hostcat/'.$vo.id).'?host_id='.$host_id}" method="post">
                <input type="hidden" name="_method" value="delete">
                <a href="{:url('/hostcat/'.$vo.id.'/edit').'?host_id='.$host_id}" class="layui-btn layui-btn-warning layui-btn-sm">修改</a>
                <button class="layui-btn layui-btn-danger layui-btn-sm btn-delete">删除</button>
            </form>
        </td>
    </tr>
    {/volist}
    {/volist}
    </tbody>
</table>
<!--分页-->
{/block}

{block name="js"}
<script type="text/javascript">
    $('.btn-delete').click(() => {
        let flag = confirm('您真的要删除这条数据吗？');
        return flag ? true : false;
    });
</script>
{/block}
